package Auxiliary;

import java.util.Vector;
import javax.swing.JOptionPane;
import DataView.Value;


public class Sequence_Value 
{
	private Vector<Value> val;
	
	public Sequence_Value()
	{
		this.val = new Vector<Value>();
	}
	
	public void add(Value v)
	{
		val.add(v);
	}
	
	public void delete(Value v)
	{
		if(val.contains(v))
			val.remove(v);
		
		else
		{
			JOptionPane.showMessageDialog(null,
					"Elemento non presente", "Error",
					JOptionPane.WARNING_MESSAGE);
			
		}
	}
	
	public Value get(int i)
	{
		return val.get(i);		
	}
	
	public Vector<Value> getAll()
	{
		return val;
	}
	
	
	public int size()
	{
		return val.size();
		
	}

	public boolean uguale(Sequence_Value values) 
	{
		boolean bool=true;
		int i=0;
		for(Value v : val)
			if(v.getName().compareTo(values.get(i++).getName())!=0)
				bool=false;
		return bool;
	}
}